package com.bluno.view.obj;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.MotionEvent;


public class Button extends TouchableObj{

	public int timer = 0;
	private float t_x;
	private float t_y;
	@Override
	public int touch(MotionEvent event) {
		if(event.getAction() == MotionEvent.ACTION_DOWN)
		{
			t_x = event.getX();
			t_y = event.getY();
			super.setIndex(1);
			timer = 3;
			this.action();
			return 1;
		}
		return 0;
	}
	@Override
	public void outTouch() {
		super.setIndex(0);
	}
	@Override
	public void action() {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void draw(Canvas canvas,Paint paint) {
		if(timer > 0)
		{
			-- timer;
		}
		else{
			this.setIndex(0);
		}
		super.draw(canvas, paint);
		
	}
	public float getT_x() {
		return t_x;
	}
	public void setT_x(float t_x) {
		this.t_x = t_x;
	}
	public float getT_y() {
		return t_y;
	}
	public void setT_y(float t_y) {
		this.t_y = t_y;
	}
	
}
